Grammar framework